import type { ComponentPublicInstance, Ref } from 'vue'
import { type TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults'
import type { KitegoTableSelectModel } from '@/components/kitegoTable/index.vue'
import KitegoTable from '@/components/kitegoTable/index.vue'

export interface PageableModel {
    page: number
    pageSize: number
    total: number
}
export interface StatePropsModel {
    tableData: any[]
    pageable: PageableModel
    searchParam: {
        [key: string]: any
    }
    totalParam: {
        [key: string]: any
    }
    icon?: {
        [key: string]: any
    }
    loading: boolean
}

// 以下是表格列设置类型
export type TypeProps = 'index' | 'selection' | 'radio' | 'expand' | 'sort'

export interface ColumnProps<T = any>
    extends Partial<Omit<TableColumnCtx<T>, 'type' | 'children' | 'renderCell' | 'renderHeader'>> {
    type?: TypeProps // 列类型
    tag?: boolean | Ref<boolean> // 是否是标签展示
    isHide?: boolean | Ref<boolean> // 是否显示在表格当中
}

export type KitegoTableInstance = Omit<
    InstanceType<typeof KitegoTable>,
    keyof ComponentPublicInstance | keyof KitegoTableSelectModel
>
